﻿using System;
using System.Windows.Data;
using RapidDownloader.Model.Helpers;

namespace RapidDownloader.Modules.Views.Markup
{
    public sealed class FormatSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return System.Convert.ToInt64(value).FormatSize();
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}